<?php
namespace app\common\model\mysql;

use think\model;


class User extends Model{

    protected $autoWriteTimestamp = true;
    /**
     * 通过手机号查询用户
     * @param $phoneNumber
     * @return array|bool|Model|null
     * @throws \think\db\exception\DataNotFoundException
     * @throws \think\db\exception\DbException
     * @throws \think\db\exception\ModelNotFoundException
     */
    public function getUserByPhoneNumber($phoneNumber){
        if(empty($phoneNumber)){
            return false;
        }

        $where = [
            "phone_number" => trim($phoneNumber),
        ];

        $result = $this->where($where)->find();
        return $result;
    }




}